<template>
  <div class="content-item-wrapper">
    <div style="display: flex; justify-content: space-between;">
        <p class="title">{{ content.trainingName }}</p>
        <div class="top">{{ content.typeName }}</div>
    </div>
    <div class="content">
      <div ref="content" style="float: left;">
        <p class="desc">{{ content.trainingIntro }}</p>
      </div>
      <img ref="img" v-if="content.trainingThum && content.trainingThum.length > 0" v-lazy="content.trainingThum"/>
    </div>
    <div class="bottom">
        <p class="author">{{ content.orgName }}</p>
        <p class="avtive-time">{{ content.createAt }}</p>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    content: {
      type: Object,
      default: {}
    }
  },
  data () {
    return {
    }
  },
  mounted () {
    this.$refs.content.style.width = (window.innerWidth - this.$refs.img.clientWidth - 50) + 'px'
  }
}
</script>

<style lang="stylus" scoped>
@import '~assets/stylus/variable.styl';

.content-item-wrapper {
  background-color: #fff;
  padding: 10px 15px;
  text-align: left;
  word-break:break-all;
  .top {
    font-size: 13px;
    color: $color-text-light;
    text-align: right;
  }

  .title {
    display: block;
    font-size: 16px;
    margin-bottom: 9px;
    font-weight: bold;
    line-height: 1.3rem;
    color: $color-text-dark
  }

  .content {
    &:after {
      clear: both;
      content: "";
      display: block;
    }
    .desc {
      font-size: 15px;
      color: $color-text;
      text-indent: 2em;
      line-height: 1.4rem;
    }
    img {
      width: 65px;
      height: 65px;
      float: right;
    }
  }

  .bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    color: $color-text-light;
    font-size: 13px;

    .author {
      width: 49%;
    }
    .avtive-time {
      text-align: right;
    }
  }
}
</style>


